//
//  OptionTableViewCell.m
//  礼物go
//
//  Created by dllo on 16/6/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "OptionTableViewCell.h"


@implementation OptionTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }

    return self;
}

-(void)createSubviews{
    self.headerImageView = [[UIImageView alloc] init];
    self.headerImageView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.headerImageView];
    
    self.nameLabel = [[UILabel alloc] init];
    
    //self.nameLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.nameLabel];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:self.lineView];
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.headerImageView.frame = CGRectMake(10, 10, 35, self.contentView.frame.size.height - 20);
    
    self.nameLabel.frame = CGRectMake(self.headerImageView.frame.origin.x + self.headerImageView.frame.size.width + 20, 0, 260, self.contentView.frame.size.height);
    
    self.lineView.frame = CGRectMake(10, self.contentView.frame.size.height - 1, self.contentView.frame.size.width - 10, 1);
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
